package com.wiscamp.ninechapters.panels.domain.repositories;

import com.wiscamp.ninechapters.panels.domain.entities.User;
import cube.ddd.common.query.PagedObjects;
import cube.ddd.common.query.PagedQuery;

import java.util.Collection;

public interface UserRepository {

    User getUser(long userId);

    User getUserByCode(long appId, String userCode);

    Collection<User> getUsersByName(long appId, String userName);

    Collection<User> getUsersByIds(Collection<Long> userIds);

    PagedObjects<User> getUsersByQuery(PagedQuery query);

    User saveUser(User user);

    boolean bindUserRole(long userId, long roleId);

    boolean unbindUserRole(long userId, long roleId);
}
